package com.zb.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zb.annotation.NumberLengthPattern;
import com.zb.annotation.NumberPattern;
import com.zb.entity.OrderGoodsCodeVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * @Author WEN
 * @Date 2023/9/20 0020
 **/
@Data
@ApiModel("工单商品对象")
public class OrderGoodsVo {
    @ApiModelProperty(value = "工单商品ID，新增不必传，修改必传")
    private Long id;

    @NotNull(message = "商品ID不能为空")
    @ApiModelProperty(value = "商品ID", required = true)
    private Long goodsId;

    @NotNull(message = "商品规格ID不能为空")
    @ApiModelProperty(value = "商品规格表ID", required = true)
    private Long goodsSpecId;

    @NotNull(message = "商品数量不能为空")
    @NumberLengthPattern(max = 4, message = "商品数量长度限制4个字符以内")
    @NumberPattern(regexp = "^[1-9]\\d{0,3}$", message = "商品数量长度限制4个字符以内")
    @ApiModelProperty(value = "商品品数量", required = true, example = "1")
    private Integer qty;

    @ApiModelProperty(value = "购买时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date buyTime;

    @ApiModelProperty(value = "到期时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date endTime;

    @ApiModelProperty(value = "防伪编码ID")
    private List<Long> codeIds;

    @ApiModelProperty(value = "工单商品编码对象", hidden = true)
    private List<OrderGoodsCodeVo> goodsCodes;

    private String goodsBrand;
    private String goodsModel;
    private String goodsName;
    private String goodsSpecName;
    private String goodsType;
    private Integer warrantyDay;
    private String type;
    private String image;
}
